package util;
import java.sql.Connection;
import java.sql.DriverManager;

public class DatabaseConnection {
	private Connection con = null;
	private static final String DRIVER = "sun.jdbc.odbc.jdbcOdbcDriver";
	private static final String USER = "system";
	private static final String URL = "jdbc:oracle:thin:127.0.0.1:1521:YL-201311040037";
	private static final String PASS = "huangjiashun";
	public DatabaseConnection()throws Exception{
		Class.forName(DRIVER);
		con = DriverManager.getConnection(URL,USER,PASS);
	}
	public Connection getConnection()throws Exception{
		return con;
	}
	public void close()throws Exception{
		if(con!=null){
			con.close();
		}
	}

}